Embarrassing crutch to allow intentional leak of xsi schema.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 6 Apr 2004 15:22:43 +0000 (15:22 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 6 Apr 2004 15:22:43 +0000 (15:22 +0000)
gpsbabel/gpx.c

index 4aca5e38e9ce8470fd5f8e4066a377b22fc33e26..ff111654b8237e711321cd498fbe53bbba8f07cb 100644 (file)
@@ -798,7 +798,14 @@ gpx_rd_init(const char *fname)
        cdatastr = vmem_alloc(1, 0);
        *((char *)cdatastr.mem) = '\0';
 
-       xsi_schema_loc = xstrdup(DEFAULT_XSI_SCHEMA_LOC);
+       /* We don't use xstrdup here becuase we' know we don't free
+        * this across reads and we unlock the safety belt from the 
+        * leak tester.
+        */
+       xsi_schema_loc = strdup(DEFAULT_XSI_SCHEMA_LOC);
+       if (!xsi_schema_loc) {
+               fatal("gpx: Unable to allocate %d bytes of memory.\n", strlen(DEFAULT_XSI_SCHEMA_LOC) + 1);
+       }
 
        XML_SetElementHandler(psr, gpx_start, gpx_end);
        XML_SetCharacterDataHandler(psr, gpx_cdata);